<script setup lang="ts">
const screen = ref()
// 计算大屏缩放比例
const getScale = (w = 1920, h = 1080) => {
  const ww = window.innerWidth / w
  const wh = window.innerHeight / h
  return ww < wh ? ww : wh
}
const delHandlerMouseEnter = () => {
  console.log(123)
}
onMounted(() => {
  screen.value.style.transform = `scale(${getScale()}) translate(-50%, -50%)`
  // delHandlerMouseEnter()
})
// 监听屏幕大小变化
window.onresize = () => {
  screen.value.style.transform = `scale(${getScale()}) translate(-50%, -50%)`
}
</script>

<template>
  <div class="container">
    <div class="screen" ref="screen">
      <div class="bullet-wrap">
        <div class="bullet-item">公告信息内容</div>
      </div>

      <div class="block text-center">
        <el-carousel height="1080px" :interval="6000" indicator-position="none" :pause-on-hover="false">
          <el-carousel-item v-for="item in 4" :key="item">
            <h3 class="small justify-center" text="2xl">{{ item }}</h3>
          </el-carousel-item>
        </el-carousel>
      </div>

      <div class="top">
        <!-- <Top /> -->
      </div>
      <div class="bottom">
        <div class="left">
          <!-- <Tourist class="tourist" />
          <Sex class="sex" />
          <Age class="age" /> -->
        </div>
        <div class="center">
          <!-- <Map class="map" /> -->
          <!-- <Center2 class="center2" /> -->
        </div>
        <div class="right">
          <!-- <Rank class="tourist" />
          <Year class="sex" />
          <Counter class="age" /> -->
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.container {
  width: 100vw;
  height: 100vh;
  background: url(./images/bg.png) no-repeat;
  background-size: cover;
  .screen {
    width: 1920px;
    height: 1080px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform-origin: left top;

    .bullet-item {
      z-index: 1;
      bottom: 10px;
      background-color: #333;
      color: yellow;
      font-size: 40px;
      position: absolute;
      animation: rightToLeft 30s infinite;
    }
    @keyframes rightToLeft {
      0% {
        transform: translate(100vw);
      }
      100% {
        transform: translate(-100%);
      }
    }
    .demonstration {
      color: var(--el-text-color-secondary);
    }

    .el-carousel__item h3 {
      color: #475669;
      font-size: 40px;
      opacity: 0.75;
      line-height: 80px;
      margin: 0;
      text-align: center;
    }

    .el-carousel__item:nth-child(2n) {
      background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n + 1) {
      background-color: #d3dce6;
    }
  }
  .top {
    width: 100%;
    height: 40px;
  }
  .bottom {
    width: 100%;
    display: flex;
    .left {
      flex: 1;
      // height: 1040px;
      display: flex;
      flex-direction: column;
      .tourist {
        flex: 1.5;
      }
      .sex {
        flex: 1;
      }
      .age {
        flex: 1;
      }
    }
    .center {
      flex: 3;
      margin: 84px, 10px, 10px, 10px;

      // height: 1006px;
      display: flex;
      flex-direction: column;
      .map {
        flex: 3;
      }
      .center2 {
        flex: 1;
      }
    }
    .right {
      flex: 1;
      height: 1040px;
      display: flex;
      flex-direction: column;
      .tourist {
        flex: 1.5;
      }
      .sex {
        flex: 1;
      }
      .age {
        flex: 1;
      }
    }
  }
}
</style>
